package com.dilili;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

/**
 * @Description: TODO
 * @Data: 2020-06-01 13:35:27
 * @Pacakge: com.dilili
 * @ClassName: HelloService
 * @Version: v1.0.0
 * @Author: dilili
 */
@Service
public class HelloService {
    @Autowired
    RestTemplate restTemplate;

    @Value("${remote.eureka.servername}")
    private String serverName;

    public String hiService(String name) {
        return restTemplate.getForObject("http://" + serverName + "/hi?name="+name,String.class);
    }
}
